home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 028a / zipdate.zip / ZIPDATE.PAS < prev    next >
Pascal/Delphi Source File  |  1989-09-09  |  1KB  |  50 lines

  1. Program ZipDate;
  2.  
  3. Uses Dos, MyProcs, Zipper;
  4.  
  5. var
  6.   DirInfo : SearchRec;
  7.   Updated : boolean;
  8.   Total, UpTotal : integer;
  9.   Path    : PathStr;
  10.   Dir     : DirStr;
  11.   Name    : NameStr;
  12.   Ext     : ExtStr;
  13.  
  14. begin
  15.   if ParamCount < 1 then
  16.   begin
  17.     writeln('Syntax:  ZipDate [filespec]');
  18.     halt;
  19.   end;
  20.   Path := ParamStr(1);
  21.   FSplit(Path,Dir,Name,Ext);
  22.   if upString(Ext) = '.ZIP' then
  23.   begin
  24.     Total := 0; UpTotal := 0; Updated := false;
  25.     writeln('ZipDate v1.0 - Chris Hall - PC Network (505) 821-5341');
  26.     writeln;
  27.     writeln('Updating ZipFile Dates to the latest file date.  Please Wait!');
  28.     writeln;
  29.     FindFirst(Path,AnyFile,DirInfo);
  30.     while DosError = 0 do
  31.     begin
  32.       GetLatestDate(DirInfo,Updated);
  33.       inc(Total);
  34.       if Updated then
  35.       begin
  36.         inc(UpTotal);
  37.         Updated := false;
  38.       end;
  39.       FindNext(DirInfo);
  40.     end;
  41.     writeln;
  42.     writeln('Complete!');
  43.     writeln;
  44.     writeln(Total,' files Processed.  ',Uptotal,' files Updated');
  45.   end
  46.   else
  47.     writeln('ZipDate can only process ZIP files!');
  48. end.
  49.  
  50.